package com.zbkj.service.settlement;

import java.math.BigDecimal;

/**
 * 结算比例
 * 目前为静态配置，未来可考虑改为DB配置
 * @author tianzhonghai
 * 2023/10/6 19:53
 */
public class SettleRateConfig {

   /**
    * 买卖订单结算比例
    * @return
    */
   public static SettleRate getOrderSettleRate() {
      SettleRate orderSettleRate = new SettleRate();
      orderSettleRate.setKey(SettlementConstants.ORDER);
      orderSettleRate.setUidRate(new BigDecimal("0"));
      orderSettleRate.setMerOwnerRate(new BigDecimal("0.35"));
//      orderSettleRate.setMerSpreadRate(new BigDecimal("0.05"));
      orderSettleRate.setMerManagerRate(new BigDecimal("0.05"));
      orderSettleRate.setSpread1Rate(new BigDecimal("0.4"));
      orderSettleRate.setSpread2Rate(new BigDecimal("0.05"));
      orderSettleRate.setMerRate(new BigDecimal("0.15"));
      return orderSettleRate;
   }

   /**
    * 共享订单结算比例
    * @return
    */
   public static SettleRate getRentSettleRate() {
      SettleRate rentSettleRate = new SettleRate();
      rentSettleRate.setKey(SettlementConstants.RENT);
      rentSettleRate.setUidRate(new BigDecimal("0.5"));
      rentSettleRate.setMerOwnerRate(new BigDecimal("0.15"));
//      rentSettleRate.setMerSpreadRate(new BigDecimal("0.05"));
      rentSettleRate.setMerManagerRate(new BigDecimal("0.025"));
      rentSettleRate.setSpread1Rate(new BigDecimal("0.15"));
      rentSettleRate.setSpread2Rate(new BigDecimal("0.025"));

      rentSettleRate.setMerRate(new BigDecimal("0.35"));
      return rentSettleRate;
   }

   /**
    * 会员充值升级结算比例
    * @return
    */
   public static SettleRate getUpgradeSettleRate() {
      SettleRate upgradeSettleRate = new SettleRate();
      upgradeSettleRate.setKey(SettlementConstants.UPGRADE);
      upgradeSettleRate.setUidRate(new BigDecimal("0"));
      upgradeSettleRate.setMerOwnerRate(new BigDecimal("0.01"));
//      upgradeSettleRate.setMerSpreadRate(new BigDecimal("0"));
      upgradeSettleRate.setMerManagerRate(new BigDecimal("0.0025"));
      upgradeSettleRate.setSpread1Rate(new BigDecimal("0.01"));
      upgradeSettleRate.setSpread2Rate(new BigDecimal("0.0025"));

      // 他们要求改为0
      upgradeSettleRate.setBaseAmount(new BigDecimal("0"));
      upgradeSettleRate.setSpread1Amount(new BigDecimal("399"));
      upgradeSettleRate.setSpread2Amount(new BigDecimal("199"));

      upgradeSettleRate.setMerRate(new BigDecimal("0.01"));
      return upgradeSettleRate;
   }
}
